﻿
@{
    ViewData["Title"] = "会计档案信息录入";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section Head{
    <link href="~/layuiadmin/style/style.css" rel="stylesheet" />
    <style>
        .layui-input:focus {
            border-color: #1ab394 !important;
        }

        .layui-input {
            height: 30px !important;
        }

        .layui-form-select {
            width: 100px;
            display: inline-block;
        }

        .layui-btn + .layui-btn {
            margin-left: 0;
        }

        .layui-btn {
            margin-top: -3px;
        }

        .text-success {
            color: #1c84c6;
        }

        .layui-btn-container {
            margin: 0 !important;
        }
    </style>
}

<div id="dMain">
    <div class="layui-row">
        <div class="layui-card">
            <div class="layui-card-header">会计档案</div>
            <div class="layui-card-body">
                <div class="layui-form">
                    <input type="text" class="layui-input" name="txtFileNo" id="txtFileNo" lay-verify="txtFileNo" placeholder="档号" autocomplete="off" style="width:120px;display: inline-block;" />
                    <select name="ddlFTerm" id="ddlFTerm">
                        <option value="-- 期限 --">-- 期限 --</option>
                        <option value="1">永久</option>
                        <option value="2">长期</option>
                        <option value="2">60年</option>
                        <option value="3">短期</option>
                        <option value="3">30年</option>
                    </select>
                    <input type="text" class="layui-input" name="txtAY" id="txtAY" lay-verify="txtAY" placeholder="实物说明" autocomplete="off" style="width:200px;display: inline-block;" />
                    <button class="layui-btn layui-btn-sm">快速检索</button>
                    <button class="layui-btn layui-btn-sm">综合检索</button>
                    <button class="layui-btn layui-btn-sm">查看全部</button>
                </div>
                <table id="tabData" lay-filter="demo" style="margin-top: 10px;"></table>
            </div>
        </div>
    </div>
</div>

<script>
    window.onload = function () {
        layui.use('table', function () {
            var table = layui.table;

            table.render({
                elem: '#tabData',
                toolbar: '#toolbarDemo', //开启头部工具栏，并为其绑定左侧模板
                page: true,
                height: 600,
                cols: [[
                    { type: 'checkbox' },
                    { field: 'AJDH', title: '案卷级档号', width: 180, align: "center", sort: true },
                    { field: 'QZH', title: '全宗号', width: 100, align: "center", sort: true },
                    { field: 'KJYear', title: '会计年度', width: 100, align: "center", sort: true },
                    { field: 'Term', title: '保管期限', width: 100, align: "center", sort: true },
                    { field: 'STFLH', title: '实体分类号', width: 120, align: "center", sort: true },
                    { field: 'AJH', title: '案卷号', width: 100, align: "center", sort: true},
                    { field: 'Title', title: '题名', width: 600,},
                    { field: 'PageCount', title: '页数', width: 80, align: "center", sort: true },
                    { field: 'StartDate', title: '文件开始日期', width: 120, align: "center", sort: true },
                    { field: 'EndDate', title: '文件截止日期', width: 120, align: "center", sort: true},
                    { field: 'KJType', title: '会计类别', width: 150, align: "center", sort: true},
                    { field: 'WriteTime', title: '录入时间', width: 200, align: "center", sort: true},
                    { field: 'UserName', title: '录入人', width: 150, align: "center", sort: true},
                    { field: 'BuildUnit', title: '文档单位', width: 150, align: "center", sort: true },
                    { field: 'ProofName', title: '凭证名称', width: 150, align: "center", sort: true },
                    { field: 'CKZG', title: '财会主管', width: 150, align: "center", sort: true },
                    { field: 'JBKJ', title: '经办会计', width: 150, align: "center", sort: true },
                    { field: 'Months', title: '月份', width: 80, align: "center", sort: true},
                    { field: 'TotalVolume', title: '总量', width: 80, align: "center", sort: true },
                    { field: 'PartVolume', title: '分册', width: 100, align: "center", sort: true },
                    { field: 'BeforeNo', title: '前册号', width: 100, align: "center", sort: true },
                    { field: 'AfterNo', title: '后册号', width: 80, align: "center", sort: true},
                    { field: 'Departments', title: '科室', width: 150, align: "center", sort: true},
                    { field: 'PZH1', title: '凭证号起', width: 100, align: "center", sort: true },
                    { field: 'PZH2', title: '凭证号止', width: 100, align: "center", sort: true},
                    { field: 'Remark', title: '备注', width: 150, align: "center", sort: true},
                    { field: 'caozuo', title: '操作', width: 100, align: "center", templet: barDemo }
                ]],
                data: [{
                    "AJDH": "1",
                    "QZH": "2",
                    "KJYear": "3",
                    "Term": "4",
                    "STFLH": "5",
                    "AJH": "6",
                    "Title": "7",
                    "PageCount": "8",
                    "StartDate": "9",
                    "EndDate": "10",
                    "KJType": "11",
                    "WriteTime": "12",
                    "UserName": "13",
                    "BuildUnit": "14",
                    "ProofName": "15",
                    "CKZG": "16",
                    "JBKJ": "17",
                    "Months": "18",
                    "TotalVolume": "19",
                    "PartVolume": "20",
                    "BeforeNo": "21",
                    "AfterNo": "22",
                    "Departments": "23",
                    "PZH1": "24",
                    "PZH2": "25",
                    "Remark": "26"
                }]
            });
        });

        layui.use('form', function () {
            var form = layui.form;
        })

        layui.use('table', function () {
            var table = layui.table;
            //监听工具条
            table.on('tool(demo)', function (obj) {
                var data = obj.data;
                if (obj.event === 'detail') {
                    layer.msg('ID：' + data.id + ' 的查看操作');
                } else if (obj.event === 'del') {
                    layer.confirm('确定删除此行数据？', function (index) {
                        obj.del();
                        layer.close(index);
                    });
                } else if (obj.event === 'edit') {
                    layer.alert('编辑' + JSON.stringify(data))
                }
            });
        });
    }
</script>

<script type="text/html" id="barDemo">
    <a class="text-success" lay-event="edit">编辑</a> &nbsp;
    <a class="text-danger" lay-event="del">删除</a>
</script>

<script type="text/html" id="toolbarDemo">
    <div class="MenuManager-title"></div>
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="">添加信息</button>
        <button class="layui-btn layui-btn-sm" lay-event="">案卷目录打印</button>
    </div>
    <div class="layui-inline layui-inline-secate">
        <input class="layui-input" name="id" id="test-table-demoReload" autocomplete="off" placeholder="搜索" data-type="reload">
    </div>
</script>